//
//  YFLoginHelper.h
//  SquashSpark
//
//  Created by Coollang on 2017/11/14.
//  Copyright © 2017年 Coollang-YF. All rights reserved.
//

#import <Foundation/Foundation.h>

typedef void(^LSPhoneCheckResultBlock)(BOOL success,NSString *desc);
typedef void(^LSCheckDataCompleteBlock)(BOOL success,NSString *desc);
typedef void(^LSLoginCompleteBlock)(BOOL success,id desc,BOOL firstLogin);
@interface YFLoginHelper : NSObject

+ (BOOL)isChineseLanguage;

#pragma mark - 登录便捷方法
// 邮箱账号登录
+ (void)loginByEmail:(NSString *)email password:(NSString *)password complete:(LSLoginCompleteBlock)complete;
// 邮箱注册

// 第三放登录

// 邮箱账号找回密码

// 上传头像
+ (void)uploadUserHeadIconImage:(UIImage *)image completed:(void(^)(NSString *url, NSError *error))block;
// 获取并保存用户信息
+ (void)getuserInfoItemCompleted:(void(^)(NSError *error))completed;
// 上传并保存用户信息
+ (void)uploadUserInfoWithInfoItem:(UserInfoItem *)infoItem completed:(void(^)(NSError *error))completed;

#pragma mark - 检测账号密码合法性
+ (void)checkPhoneNumber:(NSString *)numberString result:(LSPhoneCheckResultBlock)result;
+ (BOOL)checkEmail:(NSString *)email;
+ (BOOL)checkPassword:(NSString *)password userPredicate:(BOOL)pre;
+ (BOOL)checkPassword:(NSString *)password repeatPassword:(NSString *)rePassword complete:(LSCheckDataCompleteBlock)complete;
+ (void)checkAccount:(NSString *)account password:(NSString *)password isChinese:(BOOL)isChinese complete:(LSCheckDataCompleteBlock)complete;

// 判断年龄是否在 1-100 之间
+ (BOOL)checkAgeInOneTohundred:(NSString *)age;


+ (void)showFaultAlertViewWithMessage:(NSString *)message onClick:(void(^)())cancelAction;

@end
